import React, { Component } from 'react';
import TransferToChild11 from './Child1的子组件';
import { glabalContext } from './common/js/globalData';
const {Consumer} = glabalContext
class TransferToChild1 extends Component {
  state = {  }
  render() { 
    return ( <div>
      子组件child1：
      {/* 读取父组件的role数据 */}
      <TransferToChild11/>
      <Consumer>
        {
          value=>(<div>{value.email}
          <button onClick={()=>value.updateRole('唐三')}>修改role</button>
          </div>)
        }
      </Consumer>
      {/* 插槽传来的内容 */}
      {this.props.children}
      <br />
      {/* footer内容 */}
      具名插槽：footer{this.props.footer}
    </div> );
  }
}
 
export default TransferToChild1;